<?php

defined('SYSPATH') or die('Access error!');

class Controller_Shop_User_Main extends Controller_User_Main
{

    public function user_shop_seller_nav()
    {
        //根据用户的id获取用户的店铺
        $store_id = Model::factory('shop_store')->get_var(array('user_id' => $this->user_detail['id']), 'id');

        $user_nav_arr = array(
            array('name' => '添加商品', 'url' => URL::site(Route::get('shop/seller/goods')->uri(array('action' => 'add'))),),
            array('name' => '在售的商品', 'url' => URL::site(Route::get('shop/seller/goods')->uri(array('action' => 'onsale')))),
            array('name' => '下架产品', 'url' => URL::site(Route::get('shop/seller/goods')->uri(array('action' => 'downsale')))),
            array('name' => '产品回收站', 'url' => URL::site(Route::get('shop/seller/goods')->uri(array('action' => 'recycle')))),
            array('name' => '订单管理', 'url' => URL::site(Route::get('shop/seller/order')->uri(array('action' => 'list')))),
            array('name' => '店铺主题', 'url' => URL::site(Route::get('shop/seller/store')->uri(array('action' => 'theme')))),
            array('name' => '店铺基本设置', 'url' => URL::site(Route::get('shop/seller/store')->uri(array('action' => 'base')))),
            array('name' => '我的店铺首页', 'url' => URL::site(Route::get('store')->uri(array('action' => 'index', 'id' => $store_id)))),
        );
        return $user_nav_arr;
    }

    public function user_shop_buyer_nav()
    {
        $user_nav_arr = array(
            array('name' => '订单管理', 'url' => URL::site(Route::get('shop/buyer/order')->uri(array('action' => 'list')))),
        );
        return $user_nav_arr;
    }

    public function set_define_position($word = '', $url = '')
    {
        Breadcrumbs::add(__('my shop'), '');
        parent::get_define_position($word, $url);
    }

}